<include file="public@header"/>
<style>html {background-color: #ffffff;}</style>
</head>
<body>
<form class="layui-form js-ajax-form" action="{:url('rbac/roleeditpost')}" method="post" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label for="input-name" class="layui-form-label">
            <span class="form-required">*</span>{:lang('ROLE_NAME')}</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="input-name" required lay-verify="required" name="name" value="{$data.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="input-remark" class="layui-form-label">{:lang('ROLE_DESCRIPTION')}</label>
        <div class="layui-input-block">
            <textarea type="text" class="layui-textarea" id="input-remark" name="remark">{$data.remark}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{:lang('STATUS')}</label>
        <div class="layui-input-block">
            <div class="layui-input-inline">
                <php>$strMainMenuChecked=$data['status']?"checked":"";</php>
                <input type="checkbox" name="status" lay-skin="switch" id="status" lay-filter="status" value="{$data['status']}"
                       lay-text="{:lang('ENABLED')}|{:lang('DISABLED')}" {$strMainMenuChecked}>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id" value="{$data.id}"/>
            <button type="submit" class="layui-btn js-ajax-submit js-close" id="js-ajax-submit">{:lang('SAVE')}</button>
        </div>
    </div>
</form>
</div>
<include file="public@script"/>
<script>
    layui.use('form',function(){
        var form=layui.form;
        form.on('switch', function(data) {
            $(data.elem).attr('type', 'hidden').val(this.checked ? 1 : 0);
        });
    });
</script>
</body>
</html>